Error: GCC_ANALYZER_WARNING (CWE-688): [#def1] libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/afcclient.c: scope_hint: In function ‘device_event_cb.part.0’ libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/afcclient.c:1448:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘udid’ where non-null expected libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/afcclient.c:32: included_from: Included from here. /usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null # 1446| udid = strdup(event->udid); # 1447| } # 1448|-> if (strcmp(udid, event->udid) == 0) { # 1449| connected = 1; # 1450| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def2] libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c: scope_hint: In function ‘main’ libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:334:21: warning[-Wanalyzer-null-argument]: use of NULL ‘image_path’ where non-null expected libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/include/libimobiledevice/libimobiledevice.h:35: included_from: Included from here. libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:43: included_from: Included from here. /usr/include/sys/stat.h:205:12: note: argument 1 of ‘stat’ must be non-null # 332| } # 333| } # 334|-> if (stat(image_path, &fst) != 0) { # 335| fprintf(stderr, "ERROR: stat: %s: %s\n", image_path, strerror(errno)); # 336| goto leave; Error: GCC_ANALYZER_WARNING (CWE-688): [#def3] libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:339:51: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘image_sig_path’ where non-null expected /usr/include/sys/stat.h:205:12: note: argument 1 of ‘stat’ must be non-null # 337| } # 338| image_size = fst.st_size; # 339|-> if (product_version_major < 17 && stat(image_sig_path, &fst) != 0) { # 340| fprintf(stderr, "ERROR: stat: %s: %s\n", image_sig_path, strerror(errno)); # 341| goto leave; Error: GCC_ANALYZER_WARNING (CWE-775): [#def4] libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:380:28: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(image_sig_path, "rb")’ # 378| goto leave; # 379| } # 380|-> if (fstat(fileno(f), &fst) != 0) { # 381| fprintf(stderr, "Error: fstat: %s\n", strerror(errno)); # 382| goto leave; Error: GCC_ANALYZER_WARNING (CWE-401): [#def5] libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:380:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(image_sig_path, "rb")’ # 378| goto leave; # 379| } # 380|-> if (fstat(fileno(f), &fst) != 0) { # 381| fprintf(stderr, "Error: fstat: %s\n", strerror(errno)); # 382| goto leave; Error: GCC_ANALYZER_WARNING (CWE-688): [#def6] libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:398:29: warning[-Wanalyzer-null-argument]: use of NULL ‘image_path’ where non-null expected /usr/include/sys/stat.h:205:12: note: argument 1 of ‘stat’ must be non-null # 396| } # 397| } else { # 398|-> if (stat(image_path, &fst) != 0) { # 399| fprintf(stderr, "Error: stat: '%s': %s\n", image_path, strerror(errno)); # 400| goto leave; Error: GCC_ANALYZER_WARNING (CWE-688): [#def7] libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:398:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘image_path’ where non-null expected /usr/include/sys/stat.h:205:12: note: argument 1 of ‘stat’ must be non-null # 396| } # 397| } else { # 398|-> if (stat(image_path, &fst) != 0) { # 399| fprintf(stderr, "Error: stat: '%s': %s\n", image_path, strerror(errno)); # 400| goto leave; Error: GCC_ANALYZER_WARNING (CWE-775): [#def8] libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:505:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(string_build_path(image_path, plist_get_string_ptr(plist_access_path(build_identity, 4, "Manifest", "PersonalizedDMG", "Info", "Path"), 0), 0), "rb")’ # 503| } else { # 504| /* we need to re-connect in this case */ # 505|-> mobile_image_mounter_free(mim); # 506| mim = NULL; # 507| if (mobile_image_mounter_start_service(device, &mim, TOOL_NAME) != MOBILE_IMAGE_MOUNTER_E_SUCCESS) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def9] libimobiledevice-1.3.0_20240916gited9703d-build/libimobiledevice-ed9703db1ee6d54e3801b618cee9524563d709e1/tools/ideviceimagemounter.c:505:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(string_build_path(image_path, plist_get_string_ptr(plist_access_path(build_identity, 4, "Manifest", "PersonalizedDMG", "Info", "Path"), 0), 0), "rb")’ # 503| } else { # 504| /* we need to re-connect in this case */ # 505|-> mobile_image_mounter_free(mim); # 506| mim = NULL; # 507| if (mobile_image_mounter_start_service(device, &mim, TOOL_NAME) != MOBILE_IMAGE_MOUNTER_E_SUCCESS) {
analyzer-version-clippy | 1.82.0 |
analyzer-version-cppcheck | 2.16.0 |
analyzer-version-gcc | 14.2.1 |
analyzer-version-gcc-analyzer | 15.0.0 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
diffbase-analyzer-version-clippy | 1.82.0 |
diffbase-analyzer-version-cppcheck | 2.16.0 |
diffbase-analyzer-version-gcc | 14.2.1 |
diffbase-analyzer-version-gcc-analyzer | 15.0.0 |
diffbase-analyzer-version-shellcheck | 0.10.0 |
diffbase-analyzer-version-unicontrol | 0.0.2 |
diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
diffbase-exit-code | 0 |
diffbase-host | ip-172-16-1-250.us-west-2.compute.internal |
diffbase-mock-config | fedora-rawhide-gcc-latest-x86_64 |
diffbase-project-name | libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41 |
diffbase-store-results-to | /tmp/tmpau1trt9d/libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41.tar.xz |
diffbase-time-created | 2024-11-13 01:22:43 |
diffbase-time-finished | 2024-11-13 01:25:02 |
diffbase-tool | csmock |
diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpau1trt9d/libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpau1trt9d/libimobiledevice-1.3.0^20230705git6fc41f5-5.fc41.src.rpm' |
diffbase-tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-250.us-west-2.compute.internal |
mock-config | fedora-rawhide-gcc-latest-x86_64 |
project-name | libimobiledevice-1.3.0^20240916gited9703d-1.fc42 |
store-results-to | /tmp/tmpkffq2liu/libimobiledevice-1.3.0^20240916gited9703d-1.fc42.tar.xz |
time-created | 2024-11-13 01:25:27 |
time-finished | 2024-11-13 01:27:34 |
title | Newly introduced findings |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpkffq2liu/libimobiledevice-1.3.0^20240916gited9703d-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpkffq2liu/libimobiledevice-1.3.0^20240916gited9703d-1.fc42.src.rpm' |
tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |